<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<!-- 使用UTF-8 -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<!-- 设置移动终端可视区域 -->
		<meta content="telephone=no" name="format-detection">
		<!-- 禁止iPhone等手机自动将数字变成可点击的拨号连接 -->
		<title>登录</title>
		<link href="css/style.css" type="text/css" rel="stylesheet" />
		<link href="css/weui.css" type="text/css" rel="stylesheet" />
	</head>
	<body>
		<div id="containerVue" v-cloak>
			<div class="login">
				<div class="login_bg">
					<img src="image/login-pic.png" alt="" class="img">
					<img src="image/sysName.png" alt="" class="icon">
				</div>
				<div class="cont">
					<div class="nav">
						<div class="select">
							<img src="image/rem3.png" alt="">
							<span>业主用户</span>
							<div class="hr"></div>
						</div>
					</div>
				</div>
				<div class="login_input">
					<img class="login_input_icon" src="image/iphone.png" alt="" />
					<input type="number" placeholder="请输入手机号码" v-model="param.mobile" />
				</div>
				<div class="btn" @click="login">
					登录<i></i>
				</div>
			</div>
		</div>
		<script src="script/jquery-3.5.js"></script>
		<script src="script/vue.js"></script>
		<script src="script/api.js"></script>
		<script src="script/ajax.js"></script>
		<!-- <script src="../js/common/mui.min.js"></script> -->
		<!-- <script src="../js/common/openview.js"></script> -->
		<script>
			var app = new Vue({
				el: '#containerVue',
				data: {
					param: {
						"mobile": ""
					},
					tipShow: false,
					tips: '',
				},
				created() {

				},
				watch: {},
				methods: {
					login() {
						var that = this,
							regPhone = /^[1][3,4,5,7,8][0-9]{9}$/;
						if (!regPhone.test(this.param.mobile)) {
							$.Jwarning("请输入正确的手机号")
						} else {
							loginHttp({
								url: 'jeecg-boot/sys/phoneLogin',
								type: 'post',
								data: that.param,
								success: function(res) {
									// console.log(res);
									// 本地存入token
									if (res.code == '200') {
										localStorage.setItem('access_token', res.result['token']);
										window.location.href = "index.html";
									}else {
										$.Jwarning(res.message)
									}
								}
							})
						}
					}
				}
			})
		</script>
	</body>
</html>
